<!-- 导航菜单 -->
<template>
    <div :id="id">
        <!-- 无级限 -->
        <el-menu class="el-menu-demo" :default-active="activeIndex" :mode="element.attribute.direction" :text-color="element.style.color" :active-text-color="element.attribute.menuActiveColor">
            <child-menu :dataList="element.data" :element="element" :mode="mode" :pageList="pageList"></child-menu>
        </el-menu>
    </div>
</template>

<script>
import ChildMenu from '@/view/component/ChildMenu.vue';
import register from '@/js/main/register.js';
export default {
    data() {
        return {
            activeIndex: '1'
        };
    },
    props: {
        element: {
            type: Object
        },
        id: {
            type: String
        },
        pageList: {
            type: Array
        },
        mode: {
            type: Number
        }
    },
    components: { ChildMenu },
    created() {
        register.addComponent(this);
    },
    destroyed() {
        register.removeComponent(this);
    }
};
</script>
